# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=shotcut
pkgver=22.06.23
pkgrel=0
pkgdesc="Cross-platform video editor"
url="https://www.shotcut.org"
arch="all !armhf !armv7 !aarch64" # no opengl1.1 support, only 2
license="GPL-3.0-or-later"
makedepends="
	cmake
	ffmpeg-dev
	fftw-dev
	mlt-dev
	qt5-qtbase-dev
	qt5-qtmultimedia-dev
	qt5-qtquickcontrols2-dev
	qt5-qttools-dev
	qt5-qtwebsockets-dev
	qt5-qtx11extras-dev
	samurai
	"
subpackages="$pkgname-doc $pkgname-lang"
source="shotcut-$pkgver.tar.gz::https://github.com/mltframework/shotcut/archive/v$pkgver.tar.gz"
options="!check" # No test suite present

build() {
	export CXXFLAGS="$CXXFLAGS -DSHOTCUT_NOUPGRADE"
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build --target all translations
}

lang() {
	pkgdesc="Languages for package shotcut"
	install_if="$pkgname=$pkgver-r$pkgrel lang"
	amove usr/share/shotcut/translations
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
fc1fb6738e38784702ef2319d7e8563506f37ad1071f204cf91c958443df2e145b199e9ed0d6ceca693450718625a944520bf865705e1696072e89bfcfe1e752  shotcut-22.06.23.tar.gz
"
